package com.jx.db137.service.imp;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jx.db137.common.R;
import com.jx.db137.entity.Menu;
import com.jx.db137.entity.User;
import com.jx.db137.mapper.MenuMapper;
import com.jx.db137.mapper.UserMapper;
import com.jx.db137.service.MenuService;
import com.jx.db137.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author jx
 * @version 1.0
 * @Description
 * @date 2024/12/24 11:48
 */
@Service
public class UserServiceImp extends ServiceImpl<UserMapper, User> implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public List<Menu> selectUserMenuByUserId(Integer userid) {
        List<Menu> menuList=this.baseMapper.selectUserMenuByUserId(userid);
        return menuList;
    }

    @Override
    public int registerUser(@RequestBody User user) {
      return userMapper.insert(user);
    }

    @Override
    public User selectUser(Integer userid) {
        return userMapper.selectUser(userid);
    }


}
